package com.example.bookcar.mapper;

import com.example.bookcar.dto.OrderPreDTO;
import com.example.bookcar.entity.Order;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 18225
* @description 针对表【t_order(订单表)】的数据库操作Mapper
* @createDate 2023-03-01 16:36:37
* @Entity com.example.bookcar.pojo.Order
*/
@Mapper
public interface OrderMapper {

    //生成订单
    int saveOrder(Order order);

    //删除订单
    @Delete("delete from t_order where id = #{id}")
    int deleteOrderById(Integer id);

    //根据id查询订单详情
    @Select("select * from t_order where id = #{id}")
    Order getOrderById(Integer id);

    int updateOrder(Order order);

    List<Order> listOrders();
}




